#define _CRT_SECURE_NO_WARNINGS

#include "Sort.h"


void TestInsertSort()
{
	int a[] = { 2,7,1,4,3,8,5,9,6,0 };
	InsertSort(a, sizeof(a)/sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	int a[] = { 2,7,1,4,3,8,5,9,6,0 };
	ShellSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestSelectSort()
{
	int a[] = { 50,2,5,27,1,40 };
	SelectSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestHeapSort()
{
	int a[] = { 15, 1,19,25,8,34,65,4,27,7 };
	HeapSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestBubbleSort()
{
	int a[] = { 63,3,12,7,75,100,1 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSort()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	QuickSort(a, 0,sizeof(a) / sizeof(int)-1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSortNonR()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	QuickSortNonR(a, 0, sizeof(a) / sizeof(int) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestMergeSort()
{
	int a[] = { 6,1,2,7,9,3,4,5,10 };
	MergeSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestMergeSortNonR()
{
	int a[] = { 10,6,7,1,3,9,4,2,5,8 };
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}


void TestCountSort()
{
	//int a[] = { 3,2,5,7,5,4,2 };
	//int a[] = { 10,6,7,1,3,9,4,2,5,8 };
	int a[] = { -1,-3,-5,2,-3,-1,4 };
	CountSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}


int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TestMergeSortNonR();
	//TestMergeSort();
	TestCountSort();
	return 0;
}
